<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/sys/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@ include file="/WEB-INF/adminui/include/css.jsp" %>
<title>二维码管理</title>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
	<div class="row">
		<div class="col-sm-9">
			<div class="ibox">
				<div class="ibox-body">
				<div id="toolbar" class="columns pull-left">
							<qx:perm code="qrnum_DEL">
							<button type="button" class="btn btn-danger" onclick="del()" uilist-prem="company_EDIT">
								<i class="fa fa-trash hidden" aria-hidden="true"></i>删除
							</button>
							</qx:perm>
					</div>
					<div class="fixed-table-toolbar">
						<%-- <div id="toolbar" class="columns pull-left">
							<qx:perm code="qrcode_add">
							<button type="button" class="btn btn-primary" onclick="add()" uilist-prem="group_GROUP_EDIT">
								<i class="fa fa-plus hidden" aria-hidden="true"></i>添加
							</button>
							</qx:perm>
						</div> --%>
						<!-- <div class="columns pull-right">
							<button class="btn btn-success" onclick="UiList.loadTable()">查询</button>
						</div>
						<div class="columns pull-right col-md-2 nopadding">
							<input id="searchName" type="text" class="form-control" placeholder="按名称查询">
						</div> -->
					</div>
					<table id="dataTable" data-mobile-responsive="true">
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
<%@ include file="/WEB-INF/adminui/include/script.jsp" %>
<script type="text/javascript">
$(function(){
	UiList.render({
		treeId: false,
		tableConfig:{
			url: "${path}/qrCode/qrNumlistdata.json?codeid=${codeid}",
			idfield: 'qrnumid',
			columns: [
				{checkbox : true},
				{field : 'code', title : '二维码'},
				{field : 'createTime', title : '添加时间', formatter : function(value, row, index) {
					return formatDate(value, 'yyyy-MM-dd HH:mm:ss');
				}},
				{field : 'is_activation', title : '是否开通',formatter : function(value, row, index) {
					switch(''+value){
					case '0': return '未开通';
					case '1': return '已开通';
					}
					return ''+value;
				}}
				//,
				//{field : 'qrnumid', title : '操作', align : 'center', formatter : function(value, row, index) {
				//	var s = '';
				//	<qx:perm code="qrnum_del">
				//	s += '<a class="btn btn-primary btn-sm" href="javascript:;0" title="删除二维码" onclick="delQrNum(\''+value+'\')">删除二维码</a>';
				//	</qx:perm>
				//	return s;
				//}}
			]
		},
		tableParams: function(){//搜索条件
			return {search: $("#searchName").val()};
		}
	});
	
});

function del(id){
	UiList.dialog('${path}/qrCode/deleteqrnum.json', '您确定要删除选中的二维码信息吗？', '删除二维码信息成功.', {refresh:true});
}
</script>
</body>
</html>